{extend name="admin/base" /}
{block name="resources"/}{/block}
{block name="main"}
<div class="set-style">
	<dl>
		<dt><span style="color:red;">*</span>&nbsp;&nbsp;收货地址:</dt>
		<dd>
			<p><input id="address" type="text" value="{$info.shop_address}"></p>
			<p class="error">请输入收货地址</p>
		</dd>
	</dl>
	<dl>
		<dt><span style="color:red;">*</span>&nbsp;&nbsp;收件人:</dt>
		<dd>
			<p><input id="receive" type="text" value="{$info.seller_name}"></p>
			<p class="error">请输入收件人</p>
		</dd>
	</dl>
	<dl>
		<dt><span style="color:red;">*</span>&nbsp;&nbsp;电话:</dt>
		<dd>
			<p><input id="phone" type="text" value="{$info.seller_mobile}"></p>
			<p class="error">请输入联系电话</p>
		</dd>
	</dl>
	<dl>
		<dt>邮编:</dt>
		<dd>
			<p><input id="zip" type="text" value="{$info.seller_zipcode}"></p>
			
		</dd>
	</dl>
	<button class="edit_button" onclick="addReturnAjax();">提交</button>
</div>

 <script>

	/**
	 *添加物流公司
	 **/
	function addReturnAjax() {
		var address = $("#address").val();
		var receive = $("#receive").val();
		var phone = $("#phone").val();
		var zip = $("#zip").val();
 
		if (address == '') {
			$("#address").parent().next().show();
			return false;
		} else {
			$(".error").hide();
		}
		if (receive == '') {
			$("#receive").parent().next().show();
			return false;
		} else {
			$(".error").hide();
		}
		if(phone.length == 0){
			$("#phone").parent().next().show();
			return false;
		} else {
			$(".error").hide();
		}
		
		
		$.ajax({
			type : "post",
			url : "ADMIN_MAIN/order/returnsetting",
			data : {
				'address' : address,
				'real_name' : receive,
				'mobile' : phone,
				'zipcode' : zip
			},
			async : true,
			success : function(data) {
				if (data['code'] > 0) {
					    showMessage('success', data["message"],window.location.reload());

				} else {
						showMessage('error', data["message"]);
					
				}
			}
		});
	}
</script>
{/block}